<div class="issuebox">
	<table width="100%">
		<tr>
			<td width="150px" class="a-r">选择画板：</td>
			<td>
				<div class="boardbox">
					<a class="boardtitle" href="#"><i class="i_arrow"></i><i class="i_wange"></i>网页设计元素psd下载</a>
					<div class="boardlist">
						<ul>
							<li><a href="#"><i class="i_wange"></i>网页设计元素psd下载</a></li>
							<li><a href="#"><i class="i_wange"></i>网页常用图标psd下载</a></li>
							<li><a href="#"><i class="i_wange"></i>网页背景图片素材</a></li>
							<li><a href="#"><i class="i_wange"></i>cms后台管理模板</a></li>
						</ul>
						<div class="album">
							<input type="text" class="input_text" placeholder="创建画板" />
							<a class="createbtn" href="#">创建</a>
						</div>
					</div>	
				</div>
			</td>
		</tr>
		<tr>
			<td class="a-r">标题：</td><td><input type="text" name="" value="" id="" class="title_text" /></td>
		</tr>
		<tr>
			<td class="a-r">积分：</td><td><select class="jifen" name="" id=""><option value="">500</option><option value="">550</option><option value="">1000</option></select></td>
		<tr>
			<td></td><td><a style="width:62px;font-size:14px;color:#fff;line-height:24px;" class="Button blueButton Button18" href="#">发布审核</a></td>
		</tr>
	</table>
</div>
<script type="text/javascript">
var $issuebox = $('.issuebox');
$issuebox.ready(function() {
	var $selecttitle = $('.boardtitle');
	var $selectoption = $('.boardlist');
	
	var setOpiton = function() {
		$selectoption.find('a.on').removeClass('on');
		$selectoption.find('ul > li > a').each(function() {
			if($selecttitle.html() == '<i class="i_arrow"></i>' + $(this).html()) {
				$(this).addClass('on');
			}
		});
	};
	$selecttitle.click(function(e) {
		if($selectoption.is(':hidden')) {
			setOpiton();
			$selectoption.show();
			e.stopPropagation();
			$('body').bind('click', function(e) {
				if(!$selectoption.is(':hidden')) {
					$selectoption.hide();
					$('body').unbind('click');
				}
			});
		} else {
			$selectoption.hide();
			$('body').unbind('click');
		}
	});
	
	$selectoption.click(function(e) {
		$(this).find('ul > li > a').each(function() {
			$(this).click(function(e) {
				$selecttitle.html('<i class="i_arrow"></i>' + $(this).html());
				e.stopPropagation();
				$selectoption.hide();
				$('body').unbind('click');
			});
		});
		e.stopPropagation();
	});
	
	$selectoption.find('.album .createbtn').click(function() {
		var $inputEls = $selectoption.find('.album > input');
		if($inputEls.val() == '') {
			alert('请输入模板名称！');
			return;
		}
		$selectoption.find('ul').append('<li><a href="#"><i class="i_wange"></i>' + $inputEls.val() + '</a></li>');
		$inputEls.val('');
	});
});
</script>